﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;

namespace Titan
{
    public static class LambdaExtension
    {
       
        public static bool GreaterThan(this IComparable s, object value)
        {
            return s.CompareTo(value) > 0;
        }
        public static bool GreaterEqual(this IComparable s, object value)
        {
            return s.CompareTo(value) >= 0;
        }
        public static bool LessThan(this IComparable s, object value)
        {
            return s.CompareTo(value) < 0;
        }
        public static bool LessEqual(this IComparable s, object value)
        {
            return s.CompareTo(value) <= 0;
        }


        public static bool Like(this string s, string value)
        {
            return s.Contains(value);
        }
        public static bool LeftLike(this string s, string value)
        {
            return s.StartsWith(value);
        }
        public static bool RightLike(this string s, string value)
        {
            return s.EndsWith(value);
        }
        public static bool FullTextLike(this string s, string value)
        {
            return s.Contains(value);
        }

        public static bool NotLike(this string s, string value)
        {
            return !s.Contains(value);
        }
        public static bool NotLeftLike(this string s, string value)
        {
            return !s.StartsWith(value);
        }
        public static bool NotRightLike(this string s, string value)
        {
            return !s.EndsWith(value);
        }
        public static bool NotFullTextLike(this string s, string value)
        {
            return !s.Contains(value);
        }

        public static bool In(this object s, string value)
        {
            return s.ToString().Contains(value);
        }
        public static bool NotIn(this object s, string value)
        {
            return !s.ToString().Contains(value);
        }
        public static bool Custom(this object s, string value)
        {
            return false;
        }


        public static OrderType Asc(this object obj)
        {
            return OrderType.Asc;
        }
        public static OrderType Desc(this object obj)
        {
            return OrderType.Desc;
        }
    }
}
